<div id="layout_main_top">

</div>
<div id="layout_main">

<DIV class="layout_large_table_top">

</DIV>
<DIV class="layout_large_table">
{if $smarty.session.level gte 3}
<script src="./includes/javascript/updatePlayer.js" type="text/javascript"></script>
{/if}
<table id="main_table" cellspacing='0' width="100%" class="sortable">
<thead>
<tr class="menu_header">
	<th width="30px">#</th>
	{if $smarty.session.level gte 3}
	<th align='left' width="20px" class="sorttable_nosort">
		<a href="#" {popup text="Admins functions"  center=#overlib_center# wrap=#overlib_wrap# offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}>
			<img src="./images/buttons/admin.png" alt="" width="17" height="17" />
		</a>
	</th>
	<th align='left' width="20px" class="sorttable_nosort">
		<a href="#" {popup text="Remove character"  center=#overlib_center# wrap=#overlib_wrap# offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}>
			<img src="./images/buttons/delete.gif" alt="" width="17" height="17" />
		</a>
	</th>
	{/if}
	<th width="20px">
		<a href="#" {popup text="Sort by character Rank"  center=#overlib_center# wrap=#overlib_wrap# offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}>
			<img src="./images/buttons/rank.png" alt="" width="17" height="17" />
		</a>
	</th>
	<th width="40px">
		<a href="#" {popup text="Sort by Class Role"  center=#overlib_center# wrap=#overlib_wrap# offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}>
			<img src="./images/roles/class_role.png" alt="" width="17" height="17" />
		</a>
	</th>
	{if $smarty.session.class_display eq 1}
	<th class="center" width="40px">
		<a href="#" {popup text="Sort by character Class"  center=#overlib_center# wrap=#overlib_wrap# offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}>
			Class
		</a>
	</th>
	<th class="left" width="25%">
		<a href="#" {popup text="Sort by character Class" center=#overlib_center# wrap=#overlib_wrap# offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}>
			Name
		</a>
	</th>
	{elseif $smarty.session.class_display eq 2}
	<th class="left" width="25%">
		<a href="#" {popup text="Sort by character Class" center=#overlib_center# wrap=#overlib_wrap# offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}>
			Name
		</a>
	</th>
	{elseif $smarty.session.class_display eq 3}
	<th class="center" width="40px">
		<a href="#" {popup text="Sort by character Class"  center=#overlib_center# wrap=#overlib_wrap# offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}>
			Class
		</a>
	</th>
	<th class="left" width="25%">
		<a href="#" {popup text="Sort by character Class" center=#overlib_center# wrap=#overlib_wrap# offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}>
			Name
		</a>
	</th>
	{else}
	<th class="center" width="40px">
		<a href="#" {popup text="Sort by character Class"  center=#overlib_center# wrap=#overlib_wrap# offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}>
			Class
		</a>
	</th>
	<th class="left" width="25%">
		<a href="#" {popup text="Sort by character Class" center=#overlib_center# wrap=#overlib_wrap# offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}>
			Name
		</a>
	</th>
	
	{/if}

	<th width="100px">
		<a href="#" {popup text="Sort by character Race"  center=#overlib_center# wrap=#overlib_wrap# offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}>
			Race
		</a>
	</th>
	<th width="50px">
		<a href="#" {popup text="Sort by character Level"  center=#overlib_center# wrap=#overlib_wrap# offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}>
			Level
		</a>
	</th>
	<th width="75px">
		<a href="#" {popup text="Sort by character Level"  center=#overlib_center# wrap=#overlib_wrap# offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}>
			Talents
		</a>
	</th>
	
	{foreach name=categories item=categorie from=$rp_categories}

	<th width="30px" >
	{assign var="cat_name" value=$categorie.category_long_name}


		<a href="#" {popup text="Sort by $cat_name"  center=#overlib_center# wrap=#overlib_wrap# offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#}>
		{$categorie.category_short_name}
		</a>
	</th>
	{/foreach}


	{foreach name=categories item=attribute_categorie from=$attribute_categories}

	<th width="20px"  class="sorttable_nosort">
	{assign var="atrib_cat_name" value=$attribute_categorie.name}

		<img src="./images/attributes/{$attribute_categorie.picture_link}" width="17" height="17" alt="{$attribute_categorie.short_name}" width="18" height="18" {popup text="Sort by $atrib_cat_name"  center=#overlib_center# wrap=#overlib_wrap# offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#} />

	</th>
	{/foreach}
	<th width="20px"  class="sorttable_nosort">
		&nbsp;
	</th>

</tr>
</thead>
<tbody>
{foreach name=standings item=character from=$standings}

{if $smarty.session.uid eq $character.user_id}
	<tr class="row_3" id="standing{$character.player_id}">
{else}
	<tr class="row_2" id="standing{$character.player_id}">
{/if}
	<td width="30px">{$smarty.foreach.standings.iteration}</td>
	{if $smarty.session.level gte 3}

	{assign var="name" value=$character.name}
	{assign var="script_location" value="1"}

	{include file='standings_admin_edit.tpl' assign=editmenu}

	<td align='left'  width="20px">
	<img src="./images/buttons/edit.gif" alt="" {popup trigger=OnClick sticky=yes caption=$name text=$editmenu closetext='X' fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor# height='250' wrap=no width='300'} />
	</td>
	<td align='left'  width="20px">
	<img src="./images/buttons/delete.gif" alt="" onclick="javascript:deleteCharacter({$character.player_id}, 'standings')" />
	</td>
	{/if}
	<td  width="20px" sorttable_customkey="{$character.team_order}"><img src=".{$character.team_image}" alt="" width="15" height="15" {popup text=$character.team_name  center=#overlib_center# wrap=#overlib_wrap# offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#} /></td>
	
	<td  width="40px" sorttable_customkey="{$character.class_role_id}">
	{if !empty($character.role_picture)}
	<img src="./images/roles/{$character.role_picture}" alt="" width="20" height="20" {popup text=$character.class_role_name  center=#overlib_center# wrap=#overlib_wrap# offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#} />
	{else}
	<img src="./images/roles/unknown.png" alt="" width="20" height="20" {popup text="Character role unknown"  center=#overlib_center# wrap=#overlib_wrap# offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#} />	
	{/if}
	</td>
	{if $smarty.session.class_display eq 1}
		<td  width="40px" sorttable_customkey="{$character.class_id}">  <img src="./images/classes/{$character.class_picture}" alt="" width="20" height="20" /> </td>
		<td class="left"  width="100px"><a href="index.php?page=profile&pname={$character.name}">{$character.name}</a></td>
		{elseif $smarty.session.class_display eq 2}
		<td class="left"   width="100px"><a href="index.php?page=profile&pname={$character.name}" style="color: {$character.color_code};" onmouseover="this.style.textDecoration='underline'"
onmouseout="this.style.textDecoration='none'">{$character.name}</a></td>
		{elseif $smarty.session.class_display eq 3}
		<td sorttable_customkey="{$character.class_id}" width="40px">  <img src="./images/classes/{$character.class_picture}" alt="" width="20" height="20" /> </td> 
		<td  width="100px" class="left"><a href="index.php?page=profile&pname={$character.name}" style="color: {$character.color_code}" onmouseover="this.style.textDecoration='underline'"
onmouseout="this.style.textDecoration='none'">{$character.name}</a></td>
		{else}
		<td sorttable_customkey="{$character.class_id}"  width="40px">  <img src="./images/classes/{$character.class_picture}" alt="" width="20" height="20" /> </td>
		<td class="left"  width="100px"><a href="index.php?page=profile&pname={$character.name}">{$character.name}</a></td>		
		
	{/if}
	<td  width="100px">{$character.race}</td>
	<td  width="50px">{$character.level}</td>
	<td  width="75px">{$character.talent1}/{$character.talent2}/{$character.talent3}</td>

	{foreach name=categories item=categorie from=$rp_categories}

		<td  width="30px">{if isset($rp[$categorie.category_id][$character.user_id])}{$rp[$categorie.category_id][$character.user_id].rp}{else}0{/if}</td>

	{/foreach}

	{foreach name=categories item=attribute_categorie from=$attribute_categories}

	{assign var="atrib_cat_name" value=$attribute_categorie.name}
	{assign var="atrib_cat_description" value=$attribute_categorie.description}
	{if $attribute_categorie.type eq '1'}
        <td  width="20px">
        {if isset($attributes[$character.player_id][$attribute_categorie.id])}
            <img src="{if $attributes[$character.player_id][$attribute_categorie.id].value eq 1}./images/buttons/yes.png{else}./images/buttons/no.png{/if}" alt="" width="14" height="14" {popup text="$atrib_cat_description" center=#overlib_center# wrap=#overlib_wrap# offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#} />
        {else}
            <img src="./images/buttons/no.png" alt="" width="14" height="14" {popup text="$atrib_cat_description" center=#overlib_center# wrap=#overlib_wrap# offsety=#overlib_offsety# fgcolor=#overlib_fgcolor# bgcolor=#overlib_bgcolor#  textcolor=#overlib_textcolor#} />
        {/if}
        </td>
	{elseif $attribute_categorie.type eq '2'}
        <td  width="20px">{if isset($attributes[$character.player_id][$attribute_categorie.id])}{$attributes[$character.player_id][$attribute_categorie.id].value}{else}0{/if}</td>
	{/if}




	{/foreach}

	<td  width="20px"></td>
	

	
</tr>


{foreachelse}

<tr class="{cycle values="row_1,row_2"}">
	<td colspan=15>No characters could be found.</td>
</tr>

{/foreach}
</tbody>	
<tfoot>
	<tr class="{cycle values="row_1,row_2"}">
		<td colspan=17>
				{foreach item=team from=$teams name=teams}
						&nbsp;&nbsp;&nbsp;<input type='checkbox' value={$team.team_id} CHECKED><img src='{$team.team_image}'>
				{/foreach}
		</td>
	</tr>
	<tr class="{cycle values="row_1,row_2"}">
		<td colspan=17>
	
		</td>
	</tr>
	<tr class="{cycle values="row_1,row_2"}">
		<td colspan=17>
	
		</td>
	</tr>


	<tr class="menu_footer">
		<td colspan=17></td>
	</tr>
</tfoot>
</table>
</div>

<DIV class="layout_large_table_bottom">

</DIV>
</div>
<div id="layout_main_bottom">

</div>
